﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IView.DiaryAndTracking;
using DataTransferObject.DiaryAndTrackingTask.SupportClassForDiary;
using Engine;

namespace Presenter.DiaryAndTracking
{
    public class PresenterDiaryForm: Presenter
    {
        private IDiaryForm _View;
        private JskeEngine _Engine;

        public PresenterDiaryForm(IDiaryForm View, int dataAccessMode)
        {
            Presenter.changeDataServiceMode(dataAccessMode);
            _View = View;
            _Engine = JskeEngine.getInstance(dataServiceMode);
            //Doc du lieu Diary va ScheduleListEvent len Engine
            _Engine.loadDiaryDataToEngine();
            _View.loadEventTypeData(_Engine.loadEventTypeData());
        }
        public List<JskeEvent> getListJskeEvent(DateTime from, DateTime to)
        {
            return _Engine.getListJskeEvent(from, to);
        }

        public void saveListResult(List<JskeEvent> jskeEvents, List<int> listDeletedEventID, List<int> listNewEvent, EventType evt)
        {
            _Engine.saveListResult(jskeEvents, listDeletedEventID, listNewEvent, evt);
        }

        public EventType loadEventTypeData()
        {
            return _Engine.loadEventTypeData();
        }
    }
}
